package com.example.health_hjk;

import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.MediaController;
import android.widget.VideoView;

import androidx.appcompat.app.AppCompatActivity;

public class ex_video extends AppCompatActivity {
    MediaController controller;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ex_video);
        VideoView videoView = (VideoView)findViewById(R.id.videoView);
        //播放视频
        String url = "android.resource://" + getPackageName() + "/" + R.raw.m1;
        Log.i("--path--",url);
        Uri uri = Uri.parse(url);
        videoView.setVideoURI(uri);
        controller = new MediaController(this);
        videoView.setMediaController(controller);
        videoView.start();
    }
}